package com.cupster.base_super_resource;

import android.content.Intent;
import android.os.Bundle;
import android.util.ArrayMap;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;

import com.cupster.base_super_resource.gesturedetector.GesTureActivity;
import com.cupster.base_super_resource.gesturedetector.ScaleGesTureActivity;

import java.util.Map;
import androidx.appcompat.app.AppCompatActivity;

public class BaseSuperResourceActivity extends AppCompatActivity {

    DiyViewAnim diyChart;
    Map<String ,Float> datas = new ArrayMap<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_base_super_resource);








        View viewCCC = findViewById(R.id.view_ccc);
//        viewCCC.setOnTouchListener(new View.OnTouchListener() {
//            @Override
//            public boolean onTouch(View view, MotionEvent motionEvent) {
//                Log.e("touch_test","===== ViewTestCCC.[[OnTouchListener]].onTouch() ====");
//                return false;
//            }
//        });
        viewCCC.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(BaseSuperResourceActivity.this , ScaleGesTureActivity.class);
                BaseSuperResourceActivity.this.startActivity(intent);
//                Log.e("touch_test","===========================");
//                Log.e("touch_test","===== ViewTestCCC.<<OnClickListener>>.onClick() ====");
            }
        });

//        diyChart = findViewById(R.id.diy_chart);
//        diyChart.startAnim();
//        diyChartDeal();
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        Log.e("touch_test","===== Activity.dispatchTouchEvent ====");
        return super.dispatchTouchEvent(ev);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        Log.e("touch_test","===== Activity.onTouchEvent ====");
        return super.onTouchEvent(event);
    }


    private void diyChartDeal() {


        datas.put("1月",100f);
        datas.put("2月",200f);
        datas.put("3月",300f);
        datas.put("4月",500f);
        datas.put("5月",50f);
        datas.put("6月",400f);
        datas.put("7月",200f);
        datas.put("8月",30f);
        datas.put("9月",180f);
        datas.put("10月",330f);
        datas.put("11月",20f);
        datas.put("12月",400f);

        diyChart.postDelayed(new Runnable() {
            @Override
            public void run() {
//                diyChart.setHeightArr(datas);
                diyChart.startAnim();
            }
        },5000);
    }




}